{% extends "nomcom/nomcom_private_base.html" %}
{# Copyright The IETF Trust 2017, All Rights Reserved #}
{% load origin %}
{% block subtitle %}- Topics{% endblock %}
{% block nomcom_content %}
    {% origin %}
    <h2>Topics in {{ nomcom.group }}</h2>
    {% if nomcom.group.state_id == 'active' %}
        <a class="btn btn-primary my-3"
           href="{% url 'ietf.nomcom.views.edit_topic' year %}">Add new topic</a>
    {% endif %}
    {% if topics %}
        {% for topic in topics %}
            <h3 class="mt-3">{{ topic.subject }}</h3>
            <dl class="row">
                <dt class="col-sm-2">
                    Accepting feedback
                </dt>
                <dd class="col-sm-10">
                    {{ topic.accepting_feedback|yesno }}
                </dd>
                <dt class="col-sm-2">
                    Description
                </dt>
                <dd class="col-sm-10">
                    <a href="{% url 'ietf.nomcom.views.edit_template' year topic.description.id %}">{{ topic.description }}</a>
                    <br>
                </dd>
                <dt class="col-sm-2">
                    Audience
                </dt>
                <dd class="col-sm-10">
                    {{ topic.audience }}
                </dd>
                {% if nomcom.group.state_id == 'active' %}
                    <dt class="col-sm-2">
                        Actions
                    </dt>
                    <dd class="col-sm-10">
                        <a class="btn btn-primary btn-sm"
                           href="{% url 'ietf.nomcom.views.edit_topic' year topic.id %}">Edit</a>
                        <a class="btn btn-danger btn-sm"
                           href="{% url 'ietf.nomcom.views.remove_topic' year topic.id %}">Remove</a>
                    </dd>
                {% endif %}
            </dl>
        {% endfor %}
    {% else %}
        <p>
            There are no topics defined.
        </p>
    {% endif %}
{% endblock %}